package com.example.resource;

import com.example.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController extends BaseResource {

    @Autowired
    TestService testService;

    @GetMapping("hello")
    public String test() throws Exception {

        log.warn("warn");
        log.info("info");
        log.debug("debug");
        log.error("error");
        log.trace("warn");

        int i = 1 / 0;

        return "success";
    }

    @GetMapping("hello1")
    public String hello1() {

        testService.add();


        return "success";
    }
}
